package com.itheima.article.vo;

import com.itheima.article.pojo.ApArticle;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * @version 1.0
 * @description 说明
 * @package com.itheima.article.vo
 */
@Data
public class HotArticleVo extends ApArticle {
    // 文章对应的分数值, 数据库的金额 int 单位就是  分
    private Integer score;

    public static HotArticleVo build(ApArticle apArticle, Integer score){
        HotArticleVo vo = new HotArticleVo();
        BeanUtils.copyProperties(apArticle,vo);
        vo.setScore(score);
        return vo;
    }
}
